import React, { PropTypes,Component } from 'react'
import { Router } from 'react-router'
import { Provider,connect } from 'react-redux'
import {IntlProvider} from 'react-intl'

class Root extends Component {
    constructor(props,context){
        super(props,context)
    }

    render () {
        const { history, routes, routerKey,store } = this.props

        return (
            <IntlProvider locale="en">
                <Provider store={store}>
                    <Router history={history} key={routerKey} routes={routes} />
                </Provider>
            </IntlProvider>
        )
    }
}
Root.propTypes = {
    history: PropTypes.object.isRequired,
    routes: PropTypes.object.isRequired,
    routerKey: PropTypes.number,
    store:PropTypes.object.isRequired
};

export default Root
// export default connect(
//     state => ({
//         loading:state.loading
//     })
// )(Root)
